#ifndef SETWIG_H
#define SETWIG_H

//设置界面
#include <QWidget>
#include <QTcpSocket>
#include <QUdpSocket>
#include <QHostAddress>
#include <QListWidgetItem>

#include <QJsonDocument>
#include <QJsonArray>
#include <QJsonObject>
#include <QJsonParseError>
#include <QJsonValue>

#include <QFile>
#include <QTextStream>
#include "mqtthandler.h"
namespace Ui {
class SetWig;
}

class SetWig : public QWidget
{
    Q_OBJECT

public:
    explicit SetWig(QWidget *parent = 0);
    ~SetWig();

private slots:
      void dealMsg();//UDP接收信息
    void on_pushButton_search_clicked();

    void on_success_connect_tcp();//成功连接TCP
    void on_pushButton_heartbeat_clicked();

    void data_message();//json发送接收
    void on_pushButton_disconnect_clicked();

    void on_listWidget_list_itemClicked(QListWidgetItem *item);
protected:
    void paintEvent(QPaintEvent*);
private:
    Ui::SetWig *ui;
    QUdpSocket *udpSocket;
    QTcpSocket *sockettcp;

    QTcpSocket * sockettcpftp;
    QString tcpip;
};

#endif // SETWIG_H
